]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
RemoteSearch: don't sort the last explicitly sorted provider last
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 2 Mar 2013 01:27:56 +0000 (02:27 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 2 Apr 2013 19:49:57 +0000 (21:49 +0200)
It's a confusing semantic, and keeping it causes bugs in the control
center panels.

https://bugzilla.gnome.org/show_bug.cgi?id=694974

js/ui/remoteSearch.js

index cd6afdf5ac435a6e63e5e1e4e3fa7a86c97c31fb..e7cd6fea1c18a0c589cd205c8c0c822445b52b6f 100644 (file)
@@ -127,8 +127,6 @@ function remoteProvidersLoaded(loadState) {
     // Special case gnome-control-center to be always active and always first
     sortOrder.unshift('gnome-control-center.desktop');
 
-    let numSorted = sortOrder.length;
-
     loadState.loadedProviders.sort(
         function(providerA, providerB) {
             let idxA, idxB;
@@ -148,15 +146,6 @@ function remoteProvidersLoaded(loadState) {
                 return GLib.utf8_collate(nameA, nameB);
             }
 
-            if (numSorted > 1) {
-                // if providerA is the last, it goes after everything
-                if ((idxA + 1) == numSorted)
-                    return 1;
-                // if providerB is the last, it goes after everything
-                else if ((idxB + 1) == numSorted)
-                    return -1;
-            }
-
             // if providerA isn't found, it's sorted after providerB
             if (idxA == -1)
                 return 1;